import request from '@/hooks/request'

const Api = {
  addPointProduct: '/platform/pointProduct/addPointProduct',
  getPointProductList: '/platform/pointProduct/getPointProductList',
  editPointProduct: '/platform/pointProduct/editPointProduct',
  deletePointProduct: '/platform/pointProduct/deletePointProduct',
  editPointProductStatus: '/platform/pointProduct/editPointProductStatus',
}

export const addPointProduct = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.addPointProduct,
    data: parameter,
  })
}

export const getPointProductList = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.getPointProductList,
    data: parameter,
  })
}

export const editPointProduct = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.editPointProduct,
    data: parameter,
  })
}

export const deletePointProduct = (parameter: Record<any, any>) => {
  const formData = new FormData()
  formData.append('id', parameter.id)
  return request({
    method: 'post',
    url: Api.deletePointProduct,
    data: formData,
  })
}

export const editPointProductStatus = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.editPointProductStatus,
    data: parameter,
  })
}
